namespace OasisCiq.Xal
{
    // TODO: GeoRSS
    // TODO: XLink attributes

    using System.Collections.Specialized;
    using CommonTypes;
    using External;
    using XS;

    /// <summary>
    /// Complex type that defines the structure of an address with geocode details for reuse
    /// </summary>
    public class AddressType : IDataQualityGroup, IValidityDateGroup, ILanguageCodeGroup, IXLink, IExtendedAttributes
    {
        public FreeTextAddress FreeTextAddress { get; set; }

        /// <summary>
        /// Country details
        /// </summary>
        public CountryType Country { get; set; }

        public AdministrativeArea AdministrativeArea { get; set; }

        public Locality Locality { get; set; }

        public Thoroughfare Thoroughfare { get; set; }

        public Premises Premises { get; set; }

        public PostCode PostCode { get; set; }

        public RuralDelivery RuralDelivery { get; set; }

        public PostalDeliveryPoint PostalDeliveryPoint { get; set; }

        public PostOffice PostOffice { get; set; }

        public IGeoRss GeoRss { get; set; }

        public LocationByCoordinates LocationByCoordinates { get; set; }

        /// <summary>
        /// Defines the type of address. An address type can be Primary Address,
        /// Secondary Address, Rural Address, Military Address, etc.
        /// </summary>
        public AddressTypeList Type { get; set; }

        /// <summary>
        /// A unique address identifier such as postal delivery idetifier
        /// assigned to the address by local postal authority, e.g. DPID in Australia.
        /// </summary>
        public CTString AddressId { get; set; }

        /// <summary>
        /// Type of address ID used. e.g. DPID, etc
        /// </summary>
        public AddressIdTypeList AddressIdType { get; set; }

        /// <summary>
        /// A globally unique identifier assigned to the address
        /// </summary>
        public CTString Id { get; set; }

        /// <summary>
        /// The purpose the address is used for. E.g. Postal, residential,
        /// business, exchange, update, create, delete, etc
        /// </summary>
        public AddressUsageList Usage { get; set; }

        /// <summary>
        /// Mode of delivery of address. For example:
        /// rural route, normal delivery, post office box, etc.
        /// </summary>
        public DeliveryModeList DeliveryMode { get; set; }

        /// <summary>
        /// Status of the entity. e.g. Old, Current, Inactive, Active, etc
        /// </summary>
        public StatusList Status { get; set; }

        public XSDateTime DateValidFrom { get; set; }

        public XSDateTime DateValidTo { get; set; }

        /// <summary>
        /// A primary key to reference Address.
        /// </summary>
        public CTString AddressKey { get; set; }

        /// <summary>
        /// A foreign key to reference attribute Key of Address.
        /// </summary>
        public CTString AddressKeyRef { get; set; }

        public DataQualityTypeList DataQualityType { get; set; }

        public XSDateTime ValidFrom { get; set; }

        public XSDateTime ValidTo { get; set; }

        public XSLanguage LanguageCode { get; set; }

        public NameValueCollection ExtendedAttributes { get; set; }
    }
}